
// ChildView.h : interface of the CChildView class
//


#pragma once
#include "Basket.h"
#include "Animal.h"
#include "Egg.h"
#include "stdafx.h"

// CChildView window

class CChildView : public CWnd
{
public:
	CBasket *m_Basket;
	CList<CAnimal,CAnimal&> l_Animal;
	CList<CEgg,CEgg&> l_Egg;

	int m_iScore;
	int m_iLife;
	int m_iLevel;
	int m_iEgg_Catched;
	int m_iEgg_Offset_Move;

	//xu ly dem thoi gian
	UINT_PTR m_nTimer;
	unsigned long m_Tick;

	bool m_iLevelup;
	bool m_bPause;
	bool m_bRuning;
	int m_bMouse;
	int m_Mouse_x;

	unsigned long m_Time_NewEgg;
	unsigned long m_Time_NewEgg_Current;


	// bo dem chong giat mang hinh
	CDC *m_BackBufferDC;
	CBitmap *m_BackBufferBitmap;

public:
	void Pause_Play();
	void Stop();
	void NewGame();
	void Egg_proc(int toado_gio);
	void Animal_proc();
	void Game_Over();
	void Game_LevelUp();
	void Game_OnPaint(CClientDC *dc);

	void Animal_Add(int m_iAnimal_Type);
	void Animal_Remove(POSITION pos);

	void PlayDatFunk(CString TheFile,CString TheCommand);
	void Sound_BG();

public:
	CChildView();
	virtual ~CChildView();


protected:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);


	// Generated message map functions
protected:
	DECLARE_MESSAGE_MAP()
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT_PTR nIDEvent);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnClose();
public:
	virtual void Dump(CDumpContext& dc) const;
	virtual void AssertValid() const;
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnOptionsStop();
	afx_msg void OnOptionsNewgame();
	afx_msg void OnOptionsPause_Play();
};

